Auto merge of #2482 - ryanq:issue2266, r=alexcrichton
authorbors <bors@rust-lang.org>
Fri, 18 Mar 2016 17:49:04 +0000 (10:49 -0700)
committerbors <bors@rust-lang.org>
Fri, 18 Mar 2016 17:49:04 +0000 (10:49 -0700)
commitfe24df275e127f64d8ae042e9ea94d3fbd7148ec
treee9f7a01a777578654339d565aab16d9f3b08e022
parent75ef4d883dbe32b380ffdd94aa783721e476ed81
parent68f993a74a3ba55c07389be5122f53b43ab4b33a
Auto merge of #2482 - ryanq:issue2266, r=alexcrichton

Suggest the best matching target for cargo run

Targets passed to cargo compile are validated against the package. If
the target exists, it is compiled. If not, cargo will bail and offer a
suggested target name if there is a close match.

The tests create and build/run binaries and examples using filenames
that are close (or not so close) to the target names to verify that
close matching names are suggested to the user.

Sample output attached.
<img width="838" alt="screen shot 2016-03-14 at 12 32 59 pm" src="https://cloud.githubusercontent.com/assets/124247/13754913/28490e42-e9ef-11e5-9617-8d3c01106527.png">

Closes #2266